home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam36 / main.c < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  82 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24.  
  25. #include "generics.h"
  26.  
  27. void    fun(int);
  28.  
  29.  
  30. main(int argc, char *argv[])
  31. {
  32.     int    m=1, i;
  33.     
  34.     InitDynace(&argc);
  35.  
  36.     if (argc > 1)
  37.         m = atoi(argv[1]);
  38.  
  39.     for (i=0 ; i++ < m ; )
  40.         fun(i);
  41.     
  42.     return 0;
  43. }
  44.  
  45. void    fun(int i)
  46. {
  47.     object    x;
  48.  
  49. #if 1
  50.     x = StackAlloc(ShortInteger);      /*  stack allocation   */
  51. #else
  52.     x = gAlloc(ShortInteger);          /*  heap allocation  */
  53. #endif
  54.     gChangeShortValue(x, i);
  55.     gPrint(x, stdoutStream);
  56. }
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. /*
  65.  *
  66.  *    This source code is CONFIDENTIAL and
  67.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  68.  *    distribution, adaptation or use    may
  69.  *    be subject to civil and    criminal penalties.
  70.  *
  71.  *    Copyright (c) 1993 Algorithms Corporation
  72.  *    3020 Liberty Hills Drive
  73.  *    Franklin, TN  37064
  74.  *
  75.  *    ALL RIGHTS RESERVED.
  76.  *
  77.  *
  78.  *
  79.  */
  80.  
  81.  
  82.